<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
  import { mapGetters, mapActions } from 'vuex';
  import userManage from '@/api/user';

  export default {
    name: 'App',
    components: {
    },
    computed: {
      ...mapGetters({
        userInfo: 'userInfo',
        token: 'token',
      }),
    },
    async mounted() {
      // console.log(this.userInfo);
      // if (!this.token) {
      //   let ak = window.localStorage.getItem('ak');
      //   if (!ak) {
      //     let res = await userManage.login({
      //       user_name: 'admin',
      //       password: '88468d8478342c7b664e011062129a10',
      //     });
      //     ak = res.ak;
      //     window.localStorage.setItem('ak', res.ak);
      //   }
      //   this.setToken(ak);
      // }
    },
    methods: {
      ...mapActions({
        setToken: 'user/setToken',
      }),
    },
  };
</script>

<style>
  html,
  body,
  #app {
    height: 100%;
    /* min-width: 1200px; */
  }
  .global-loading {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    z-index: 999;
  }
</style>
